package com.sdl.common.base;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * @program flowerPaaS
 * @description:
 * @author: songdeling
 * @create: 2020/03/02 14:50
 */
public class Test {

    public static void main(String[] args) {
        Pattern p = Pattern.compile("\\$\\{(\\w+)\\s*(([\\+\\-])\\s*(\\d+))?\\}");

        Matcher m = p.matcher("${aaaa}asdfasdff${XXXXX}");

        while(m.find()){
            String str = m.group(0);
            str = str.substring(str.indexOf("{")+1,str.lastIndexOf("}"));
            System.out.println(str);
        }
    }
}
